home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
nivb
/
global.bas
< prev
next >
Wrap
BASIC Source File
|
1995-05-09
|
1KB
|
42 lines
'-----Global declarations specific to NWTEST-----
Global originalPrefConnID%
Global Const MAX_CONNS = 10
Global serverName$
Global volumeName$
Global dirPath$
Global currentForm As Integer
Global Const AFP_FORM = 1
Global Const FILE_FORM = 2
Global PrintServerName$
Function GetDate$ (dateVal%, timeVal%)
' converts a DOS format date and/or time to a string
'if timeVal = 0, returns just the date, and vice versa
If (dateVal% <> 0) Then
theYear% = ((dateVal% And &HFE00) / &H200) + 80
theMonth% = (dateVal% And &H1E0) / &H20
theDay% = dateVal% And &H1F
theDate$ = Format$(theMonth%, "00") + "/" + Format$(theDay%, "00") + "/" + Format$(theYear%, "00")
End If
If (timeVal% <> 0) Then
'save the sign bit, since VB doesn't have unsigned types
'should do the same with the year, but it won't matter until 2044
signBit% = timeVal% And &H8000
theHour% = (timeVal% And &H7800) / &H800
'add the sign bit back in, if it was there
If (signBit% <> 0) Then theHour% = theHour% + &H10
theMin% = (timeVal% And &H7E0) / &H20
theSec% = timeVal% And &H1F
theTime$ = Format$(theHour%, "00") + ":" + Format$(theMin%, "00") + ":" + Format$(theSec%, "00")
End If
If ((dateVal% <> 0) And (timeVal% <> 0)) Then sep$ = " "
GetDate$ = theDate$ + sep$ + theTime$
End Function